export function arrChunk(array, size) {
  size = Math.max(size, 0);
  let length = array == null ? 0 : array.length;
  if (!length || size < 1) {
    return [];
  }
  let index = 0,
    resIndex = 0,
    result = Array(Math.ceil(length / size));

  while (index < length) {
    result[resIndex++] = array.slice(index, (index += size));
  }
  return result;
}

